package com.zy.openchat.core.model.message;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

public class TextEntityType implements Parcelable {

    public static final String CircleTopicType = "textEntityTypeHashtag";
    public static final String RemiitedType = "textEntityTypeRemiitedRemindName";
    public static final String UserType = "textEntityTypeMentionName";

    @SerializedName(value = "@type")
    public String type = "textEntityTypeMentionName";
    public long user_id;
    public String url;
    public long remittanceId;

    public TextEntityType() {
    }

    public TextEntityType(long userId) {
        this.user_id = userId;
    }

    public TextEntityType(String url) {
        this.url = url;
    }


    //    @Override
//    public String toString() {
//        return "{" +
//                "@type=" + type +
//                ", userId=" + userId +
//                '}';
//    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.type);
        dest.writeLong(this.user_id);
        dest.writeString(this.url);
    }

    public void readFromParcel(Parcel source) {
        this.type = source.readString();
        this.user_id = source.readLong();
        this.url = source.readString();
    }

    protected TextEntityType(Parcel in) {
        this.type = in.readString();
        this.user_id = in.readLong();
        this.url = in.readString();
    }

    public static final Creator<TextEntityType> CREATOR = new Creator<TextEntityType>() {
        @Override
        public TextEntityType createFromParcel(Parcel source) {
            return new TextEntityType(source);
        }

        @Override
        public TextEntityType[] newArray(int size) {
            return new TextEntityType[size];
        }
    };
}
